﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Ink;

namespace RozpoznawanieCore.KsztaltyFolder
{
    class Circles : Ksztalt
    {
        public Circles(StrokeCollection stroke)
        {
            this.strokeCol = stroke;
            double minx = 999;
            double miny = 999;
            double maxx = 0;
            double maxy = 0;
            kompletny = true;
            for (int i = 0; i < stroke.Count; i++)
            {
                for (int j = 0; j < stroke[i].StylusPoints.Count; j++)
                {
                    if (stroke[i].StylusPoints[j].X > maxx) maxx = stroke[i].StylusPoints[j].X;
                    if (stroke[i].StylusPoints[j].Y > maxy) maxy = stroke[i].StylusPoints[j].Y;
                    if (stroke[i].StylusPoints[j].X < minx) minx = stroke[i].StylusPoints[j].X;
                    if (stroke[i].StylusPoints[j].Y < miny) miny = stroke[i].StylusPoints[j].Y;
                }
            }

            x1 = (int)minx;
            y1 = (int)miny;
            x2 = (int)maxx;
            y2 = (int)maxy;
            konczenie_totalne = true;
        }
    }
}
